<?	session_start(); 
	if(isset($_SESSION['id']) & isset($_SESSION['pass']))
	{
	require("koneksi.php");
	$query=mysql_query("select * from biodata where nrp like '611%' order by nrp");
	
?>
<html>
<head>
	<title>Welcome to Admin Uwika</title>
	<link rel="stylesheet" type="text/css" href="style.css">
</head>

<body leftmargin=0 topmargin=0 marginheight="0" marginwidth="0" bgcolor="#E6E6E6">

<table border="0" cellpadding="0" cellspacing="0" width="758" align="center">
<tr valign="top">
	<td>&nbsp;</td>
	<td> <img src="images/Header.jpg" width="755" height="130"></td>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="758" align="center">
<tr valign="top">
	<td width="185" background="images/fon_left03.gif">
<table border="0" cellpadding="0" cellspacing="0" background="images/fon_left01.gif" width="100%">
<tr>
	<td align="right">
<table border="0" cellpadding="0" cellspacing="0" width="165" background="images/fon_left02.gif">
<tr>
	<td background="images/left01.gif" height="26"><p class="title">FORM MASTER</p></td>
</tr>
<tr>
	<td>
<p class="b01"><img src="images/e02.gif" width="6" height="5" alt="" border="0" align="absmiddle">&nbsp;&nbsp;<a href="home.php">Beranda</a></p>
<div align="center"><img src="images/hr01.gif" width="137" height="3" alt="" border="0"></div>
<p class="b01"><img src="images/e02.gif" width="6" height="5" alt="" border="0" align="absmiddle">&nbsp;&nbsp;<a href="mahasiswa.php">Mahasiswa</a></p>
<div align="center"><img src="images/hr01.gif" width="137" height="3" alt="" border="0"></div>
<p class="b01"><img src="images/e02.gif" width="6" height="5" alt="" border="0" align="absmiddle">&nbsp;&nbsp;<a href="mata_kuliah.php">Mata Kuliah </a></p>
<div align="center"><img src="images/hr01.gif" width="137" height="3" alt="" border="0"></div>
<p class="b01"><img src="images/e02.gif" width="6" height="5" alt="" border="0" align="absmiddle">&nbsp;&nbsp;<a href="nilai.php">Nilai</a></p>
<div align="center"><img src="images/hr01.gif" width="137" height="3" alt="" border="0"></div>
<p class="b01"><img src="images/e02.gif" width="6" height="5" alt="" border="0" align="absmiddle">&nbsp;&nbsp;<a href="jadwal.php">Jadwal</a></p>
<div align="center"><img src="images/hr01.gif" width="137" height="3" alt="" border="0"></div>
<p class="b01"><img src="images/e02.gif" width="6" height="5" alt="" border="0" align="absmiddle">&nbsp;&nbsp;<a href="dosen.php">Dosen</a></p>
<div align="center"><img src="images/hr01.gif" width="137" height="3" alt="" border="0"></div>
<p class="b01"><img src="images/e02.gif" width="6" height="5" alt="" border="0" align="absmiddle">&nbsp;&nbsp;<a href="informasi.php">Informasi</a></p>
<div align="center"><img src="images/hr01.gif" width="137" height="3" alt="" border="0"></div>
<p class="b01"><img src="images/e02.gif" width="6" height="5" alt="" border="0" align="absmiddle">&nbsp;&nbsp;<a href="logout.php">Logout</a></p>
</td>
</tr>
<tr>
	<td><img src="images/left_bot02.gif" width="165" height="18" alt="" border="0"></td>
</tr>
</table>	
<br>
<table border="0" cellpadding="0" cellspacing="0" width="165" background="images/fon_left02.gif">
<tr>
	<td background="images/left02.gif" height="26"><p class="title">QUICK SEARCH</p></td>
</tr>
<tr>
	<td>
<form action="" method="post">
<p class="px5">
<div align="center"><input type="Text" name="" size="13"></div>
<p class="px5">
<div align="center"><input type="Image" src="images/b_search.gif" width="79" height="20" alt="" border="0"></div>
<p class="px5">
<p class="b01"></p>
	</td>
</tr>
</form>
<tr>
	<td><img src="images/left_bot02.gif" width="165" height="18" alt="" border="0"></td>
</tr>
</table>	
	</td>
</tr>
<tr>
	<td><img src="images/left_bot01.gif" width="185" height="32" alt="" border="0"></td>
</tr>
</table>
	</td>
	<td bgcolor="#FFFFFF" width="572">
<div align="center"><img src="images/m_top.gif" width="572" height="8" alt="" border="0"></div>
<p class="px5">
<!--isi di sini-->
<center>
<table border="1" align="center">
	<th colspan="6" bgcolor='#D3DCE3'>
		Tampilan Semua Data Mahasiswa Bahasa Tionghoa
	</th>
	<tr>
		<td>NRP</td>
		<td>Nama</td>
		<td>Password</td>
		<td colspan="3">Action</td>
	</tr>
	<?
		//inisial pembagian warna pada kolom hasil
		$color=0;
		
		//variabel batasan per halaman
		$dataPerPage = 15;
		
		
		while ($row=mysql_fetch_row($query))
		{
			$query2=mysql_query("select * from security where username='$row[0]'");
			if($color%2==0) 
			{
				echo "<tr height ='25' bgcolor='#E5E5E5'>";
			}
			else 
			{
				echo "<tr height ='25' bgcolor='#F5F5F5'>";
			}
			$color++;
			echo "<td>$row[0]</td>
			<td>$row[1]</td>";
			while($row2=mysql_fetch_row($query2))
			{		
				
				echo "<td>$row2[1]</td>";
			}
			echo "<td><input type='button' onClick='confirmation_add()' value='Tambah'></td>
			<td><input type='button' onClick='confirmation_edit($row[0])' value='Edit'></td>
			<td><input type='button' onClick='confirmation_del($row[0])' value='Delete'></td>
			";
			
			
		}
	?>
	<tr>
		<td colspan="5"><a href="form_add_mhs.php">Tambah Mahasiswa</a></td>
	</tr>
</table>
</center>
<script type="text/javascript">
<!--
function confirmation_add() 
{
	window.location = "form_add_mhs.php";
}
function confirmation_del(nrp) 
{
	var answer = confirm("Apakah anda yakin untuk menghapus data ini???")
		
	if (answer==true){
		//alert("ok")
		//alert($row[0]);
		window.location = "del_mhs.php?nrp="+nrp;
	}
	else{
		//alert("cancel")
		//window.location = "gagal.php";
	}
}
function confirmation_edit(nrp) 
{
	//var answer = confirm("edit data???")
		
	//if (answer==true){
		//alert("ok")
		//alert($row[0]);
		window.location = "form_edit_mhs.php?nrp="+nrp;
	//}
	//else{
		//alert("cancel")
		//window.location = "gagal.php";
	//}
}
//-->
</script>
<!-- sampai di sini -->
</td>
	<td bgcolor="#979797"><img src="images/px1.gif" width="1" height="1" alt="" border="0"></td>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="758" align="center">
<tr>
	<td height="52" align="right" background="images/bot.gif">
<table border="0" cellpadding="0" cellspacing="0" width="530" background="">
<tr>
	<td>
<p class="menu02">&nbsp; </p>
	</td>
</tr>
</table>
	</td>
</tr>
<tr>
	<td><p align="right" style="margin-right: 200px;">Copyright &copy;2010 Uwika IT Team </p></td>
</tr>
</table>

</body>
</html>
<? 
	}
	else
	echo "Silahkan <a href='index.php'>Login</a> dulu.";
?>